import {RouteRecordRaw} from 'vue-router'

/**
 * @function RouterAllName 静态路由转换name数组
 * @param arr
 * @param list
 * @constructor
 */
export const RouterAllName = (arr: RouteRecordRaw[], list: string[] = []) => {
  const arr1:RouteRecordRaw[] = JSON.parse(JSON.stringify(arr))
  for (const item of arr1) {
    list.push(<string>item.name)
    if (item.children) {
      RouterAllName(item.children, list)
    }
  }
}
